package secondStage.part1.Test;

/**
 * @ClassName: [AnimalDemo]
 * @Description: 老师和学生测试类
 * @Author: [黄劲松]
 * @CreateDate: [2021-02-08]
 * @Version: [v1.0]
 */
/*需求:定义老师类和学生类，然后写代码测试;最后找到老师类和学生类当中的共性内容，抽取出一个父类，
        用继承的方式改写代码，并进行测试*/
public class TestDemo {
    public static void main(String[] args) {
        //创建对象
        Teacher t1 = new Teacher();
        t1.setName("赵敏");
        t1.setAge(20);
        System.out.println(t1.getName() + "," + t1.getAge());
        t1.teach();
        Teacher t2 = new Teacher("黄衫女", 21);
        System.out.println(t2.getName() + "," + t2.getAge());
        t2.teach();
    }
}
